<template>
    <div class='router-div'>
        用户名: <input type="text" v-model="username"/>
        密码: <input type="text" v-model="password"/>
      <input type="button" value="提交" @click="submit"/>
    </div>
</template>

<script>
  import common from "../../data/common"
    export default {
        name: "login",
      data() { return{
        username:'',
        password:'',
      }},
      methods:{
          submit() {
            if (this.username=='root' && this.password =='123456') {
              this.$router.push({path:"/right/1"});
              common.isLogin = true;
            } else {
              this.$message('用户名或密码错误');
            }
          }
      }
    }
</script>

<style scoped>

</style>
